GtkWindow: Override gtk_container_remove ()
authorKjell Ahlstedt <kjell.ahlstedt@bredband.net>
Thu, 3 Oct 2013 17:07:37 +0000 (19:07 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 6 Oct 2013 03:22:43 +0000 (23:22 -0400)
Check which child is being removed, title_box or the GtkBin child.

https://bugzilla.gnome.org/show_bug.cgi?id=709049

gtk/gtkwindow.c

index c573fd1916cede7b962396cfc2774109ff50b71c..868607976a7028b89be464bd8ecfc33a9b82b227 100644 (file)
@@ -389,6 +389,8 @@ static gint gtk_window_focus_out_event    (GtkWidget         *widget,
 static void gtk_window_style_updated      (GtkWidget         *widget);
 static gboolean gtk_window_state_event    (GtkWidget          *widget,
                                            GdkEventWindowState *event);
+static void gtk_window_remove             (GtkContainer      *container,
+                                           GtkWidget         *widget);
 static void gtk_window_check_resize       (GtkContainer      *container);
 static void gtk_window_forall             (GtkContainer   *container,
                                           gboolean     include_internals,
@@ -666,6 +668,7 @@ gtk_window_class_init (GtkWindowClass *klass)
   widget_class->get_preferred_height = gtk_window_get_preferred_height;
   widget_class->get_preferred_height_for_width = gtk_window_get_preferred_height_for_width;
 
+  container_class->remove = gtk_window_remove;
   container_class->check_resize = gtk_window_check_resize;
   container_class->forall = gtk_window_forall;
 
@@ -7581,6 +7584,17 @@ gtk_window_focus_out_event (GtkWidget     *widget,
   return FALSE;
 }
 
+static void
+gtk_window_remove (GtkContainer *container,
+                  GtkWidget     *widget)
+{
+  GtkWindow *window = GTK_WINDOW (container);
+  if (widget == window->priv->title_box)
+    unset_titlebar (window);
+  else
+    GTK_CONTAINER_CLASS (gtk_window_parent_class)->remove (container, widget);
+}
+
 static void
 gtk_window_check_resize (GtkContainer *container)
 {